/*
 * ConsultarGrupo.java
 *
 * Created on 14-oct-2008, 17:12:43
 */
 
package investigaciones_itm.GruposInvestigacion;

import com.sun.data.provider.RowKey;
import com.sun.rave.faces.data.DefaultSelectItemsArray;
import com.sun.rave.faces.data.DefaultTableDataModel;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.HiddenField;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.PanelLayout;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.Tab;
import com.sun.webui.jsf.component.TabSet;
import com.sun.webui.jsf.component.Table;
import com.sun.webui.jsf.component.TableColumn;
import com.sun.webui.jsf.component.TableRowGroup;
import javax.faces.FacesException;
import investigaciones_itm.RequestBean1;
import investigaciones_itm.ApplicationBean1;
import investigaciones_itm.SessionBean1;
import itm.base.ListaTablaGrupo;
import itm.base.ListaTablaPersonas;
import itm.bo.grupoInvestigacion.GrupoInvestigacionBO;
import itm.exception.ControlException;
import itm.vo.grupoInvestigacion.GrupoInvestigacionVO;
import itm.vo.grupoInvestigacion.RolVO;
import itm.vo.personas.PersonaVO;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import javax.faces.component.UISelectItems;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlInputText;
import javax.faces.component.html.HtmlInputTextarea;
import javax.faces.component.html.HtmlMessages;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.component.html.HtmlSelectOneListbox;
import javax.faces.model.SelectItem;

/**
 * <p>Page bean that corresponds to a similarly named JSP page.  This
 * class contains component definitions (and initialization code) for
 * all components that you have defined on this page, as well as
 * lifecycle methods and event handlers where you may add behavior
 * to respond to incoming events.</p>
 *
 * @author Administrador
 */
public class ConsultarGrupo extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">

    /**
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
        tab1.setText("Tab 1");
        tab2.setText("Tab 2");
        tab3.setText("Tab 3");
        tab8.setText("Tab 8");
        tab9.setText("Tab 9");
    }

    private Page page1 = new Page();
    
    public Page getPage1() {
        return page1;
    }
    
    public void setPage1(Page p) {
        this.page1 = p;
    }
    
    private Html html1 = new Html();
    
    public Html getHtml1() {
        return html1;
    }
    
    public void setHtml1(Html h) {
        this.html1 = h;
    }
    
    private Head head1 = new Head();
    
    public Head getHead1() {
        return head1;
    }
    
    public void setHead1(Head h) {
        this.head1 = h;
    }
    
    private Link link1 = new Link();
    
    public Link getLink1() {
        return link1;
    }
    
    public void setLink1(Link l) {
        this.link1 = l;
    }
    
    private Body body1 = new Body();
    
    public Body getBody1() {
        return body1;
    }
    
    public void setBody1(Body b) {
        this.body1 = b;
    }
    
    private Form form1 = new Form();
    
    public Form getForm1() {
        return form1;
    }
    
    public void setForm1(Form f) {
        this.form1 = f;
    }
    private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel1() {
        return gridPanel1;
    }

    public void setGridPanel1(HtmlPanelGrid hpg) {
        this.gridPanel1 = hpg;
    }
    private TabSet tabSet1 = new TabSet();

    public TabSet getTabSet1() {
        return tabSet1;
    }

    public void setTabSet1(TabSet ts) {
        this.tabSet1 = ts;
    }
    private Tab tabConsultarGrupo = new Tab();

    public Tab getTabConsultarGrupo() {
        return tabConsultarGrupo;
    }

    public void setTabConsultarGrupo(Tab t) {
        this.tabConsultarGrupo = t;
    }
    private PanelLayout panelConsultar = new PanelLayout();

    public PanelLayout getPanelConsultar() {
        return panelConsultar;
    }

    public void setPanelConsultar(PanelLayout pl) {
        this.panelConsultar = pl;
    }
    private HtmlPanelGrid panelCon = new HtmlPanelGrid();

    public HtmlPanelGrid getPanelCon() {
        return panelCon;
    }

    public void setPanelCon(HtmlPanelGrid hpg) {
        this.panelCon = hpg;
    }
    private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel3() {
        return gridPanel3;
    }

    public void setGridPanel3(HtmlPanelGrid hpg) {
        this.gridPanel3 = hpg;
    }
    private HtmlOutputText labelNombre = new HtmlOutputText();

    public HtmlOutputText getLabelNombre() {
        return labelNombre;
    }

    public void setLabelNombre(HtmlOutputText hot) {
        this.labelNombre = hot;
    }
    private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel5() {
        return gridPanel5;
    }

    public void setGridPanel5(HtmlPanelGrid hpg) {
        this.gridPanel5 = hpg;
    }
    private HtmlCommandButton botonConsultar = new HtmlCommandButton();

    public HtmlCommandButton getBotonConsultar() {
        return botonConsultar;
    }

    public void setBotonConsultar(HtmlCommandButton hcb) {
        this.botonConsultar = hcb;
    }
    private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel6() {
        return gridPanel6;
    }

    public void setGridPanel6(HtmlPanelGrid hpg) {
        this.gridPanel6 = hpg;
    }
    private HtmlInputText textoNombre = new HtmlInputText();

    public HtmlInputText getTextoNombre() {
        return textoNombre;
    }

    public void setTextoNombre(HtmlInputText hit) {
        this.textoNombre = hit;
    }
    private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel8() {
        return gridPanel8;
    }

    public void setGridPanel8(HtmlPanelGrid hpg) {
        this.gridPanel8 = hpg;
    }
    private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel2() {
        return gridPanel2;
    }

    public void setGridPanel2(HtmlPanelGrid hpg) {
        this.gridPanel2 = hpg;
    }
    private DefaultTableDataModel dataTable1Model1 = new DefaultTableDataModel();

    public DefaultTableDataModel getDataTable1Model1() {
        return dataTable1Model1;
    }

    public void setDataTable1Model1(DefaultTableDataModel dtdm) {
        this.dataTable1Model1 = dtdm;
    }
    private Table table1 = new Table();

    public Table getTable1() {
        return table1;
    }

    public void setTable1(Table t) {
        this.table1 = t;
    }
    private TableRowGroup tableRowGroup1 = new TableRowGroup();

    public TableRowGroup getTableRowGroup1() {
        return tableRowGroup1;
    }

    public void setTableRowGroup1(TableRowGroup trg) {
        this.tableRowGroup1 = trg;
    }
    private TableColumn tableColumn1 = new TableColumn();

    public TableColumn getTableColumn1() {
        return tableColumn1;
    }

    public void setTableColumn1(TableColumn tc) {
        this.tableColumn1 = tc;
    }
    private StaticText staticText1 = new StaticText();

    public StaticText getStaticText1() {
        return staticText1;
    }

    public void setStaticText1(StaticText st) {
        this.staticText1 = st;
    }
    private TableColumn tableColumn2 = new TableColumn();

    public TableColumn getTableColumn2() {
        return tableColumn2;
    }

    public void setTableColumn2(TableColumn tc) {
        this.tableColumn2 = tc;
    }
    private StaticText staticText2 = new StaticText();

    public StaticText getStaticText2() {
        return staticText2;
    }

    public void setStaticText2(StaticText st) {
        this.staticText2 = st;
    }
    private TableColumn tableColumn3 = new TableColumn();

    public TableColumn getTableColumn3() {
        return tableColumn3;
    }

    public void setTableColumn3(TableColumn tc) {
        this.tableColumn3 = tc;
    }
    private StaticText staticText3 = new StaticText();

    public StaticText getStaticText3() {
        return staticText3;
    }

    public void setStaticText3(StaticText st) {
        this.staticText3 = st;
    }
    private TableColumn tableColumn4 = new TableColumn();

    public TableColumn getTableColumn4() {
        return tableColumn4;
    }

    public void setTableColumn4(TableColumn tc) {
        this.tableColumn4 = tc;
    }
    private StaticText staticText4 = new StaticText();

    public StaticText getStaticText4() {
        return staticText4;
    }

    public void setStaticText4(StaticText st) {
        this.staticText4 = st;
    }
    private TableColumn tableColumn5 = new TableColumn();

    public TableColumn getTableColumn5() {
        return tableColumn5;
    }

    public void setTableColumn5(TableColumn tc) {
        this.tableColumn5 = tc;
    }
    private StaticText staticText5 = new StaticText();

    public StaticText getStaticText5() {
        return staticText5;
    }

    public void setStaticText5(StaticText st) {
        this.staticText5 = st;
    }
    private TableColumn tableColumn6 = new TableColumn();

    public TableColumn getTableColumn6() {
        return tableColumn6;
    }

    public void setTableColumn6(TableColumn tc) {
        this.tableColumn6 = tc;
    }
    private StaticText staticText6 = new StaticText();

    public StaticText getStaticText6() {
        return staticText6;
    }

    public void setStaticText6(StaticText st) {
        this.staticText6 = st;
    }
    private TabSet tabSet2 = new TabSet();

    public TabSet getTabSet2() {
        return tabSet2;
    }

    public void setTabSet2(TabSet ts) {
        this.tabSet2 = ts;
    }
    private Tab tab1 = new Tab();

    public Tab getTab1() {
        return tab1;
    }

    public void setTab1(Tab t) {
        this.tab1 = t;
    }
    private Tab tab2 = new Tab();

    public Tab getTab2() {
        return tab2;
    }

    public void setTab2(Tab t) {
        this.tab2 = t;
    }
    private Tab tab3 = new Tab();

    public Tab getTab3() {
        return tab3;
    }

    public void setTab3(Tab t) {
        this.tab3 = t;
    }
    private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel9() {
        return gridPanel9;
    }

    public void setGridPanel9(HtmlPanelGrid hpg) {
        this.gridPanel9 = hpg;
    }
    private TabSet tabSet3 = new TabSet();

    public TabSet getTabSet3() {
        return tabSet3;
    }

    public void setTabSet3(TabSet ts) {
        this.tabSet3 = ts;
    }
    private Tab tab8 = new Tab();

    public Tab getTab8() {
        return tab8;
    }

    public void setTab8(Tab t) {
        this.tab8 = t;
    }
    private Tab tab9 = new Tab();

    public Tab getTab9() {
        return tab9;
    }

    public void setTab9(Tab t) {
        this.tab9 = t;
    }
    private Table tablaConsultaGrupo = new Table();

    public Table getTablaConsultaGrupo() {
        return tablaConsultaGrupo;
    }

    public void setTablaConsultaGrupo(Table t) {
        this.tablaConsultaGrupo = t;
    }
    private TableRowGroup tableRowGroup3 = new TableRowGroup();

    public TableRowGroup getTableRowGroup3() {
        return tableRowGroup3;
    }

    public void setTableRowGroup3(TableRowGroup trg) {
        this.tableRowGroup3 = trg;
    }
    private TableColumn tableColumn10 = new TableColumn();

    public TableColumn getTableColumn10() {
        return tableColumn10;
    }

    public void setTableColumn10(TableColumn tc) {
        this.tableColumn10 = tc;
    }
    private TableColumn tableColumn12 = new TableColumn();

    public TableColumn getTableColumn12() {
        return tableColumn12;
    }

    public void setTableColumn12(TableColumn tc) {
        this.tableColumn12 = tc;
    }
    private StaticText staticText12 = new StaticText();

    public StaticText getStaticText12() {
        return staticText12;
    }

    public void setStaticText12(StaticText st) {
        this.staticText12 = st;
    }
    private TableColumn tableColumn13 = new TableColumn();

    public TableColumn getTableColumn13() {
        return tableColumn13;
    }

    public void setTableColumn13(TableColumn tc) {
        this.tableColumn13 = tc;
    }
    private TableColumn tableColumn7 = new TableColumn();

    public TableColumn getTableColumn7() {
        return tableColumn7;
    }

    public void setTableColumn7(TableColumn tc) {
        this.tableColumn7 = tc;
    }
    private Button botonVer = new Button();

    public Button getBotonVer() {
        return botonVer;
    }

    public void setBotonVer(Button b) {
        this.botonVer = b;
    }
    private Button botonEliminar = new Button();

    public Button getBotonEliminar() {
        return botonEliminar;
    }

    public void setBotonEliminar(Button b) {
        this.botonEliminar = b;
    }
    private StaticText staticText7 = new StaticText();

    public StaticText getStaticText7() {
        return staticText7;
    }

    public void setStaticText7(StaticText st) {
        this.staticText7 = st;
    }
    private StaticText staticTextId = new StaticText();

    public StaticText getStaticTextId() {
        return staticTextId;
    }

    public void setStaticTextId(StaticText st) {
        this.staticTextId = st;
    }
    private Tab tab4 = new Tab();

    public Tab getTab4() {
        return tab4;
    }

    public void setTab4(Tab t) {
        this.tab4 = t;
    }
    private PanelLayout layoutPanel1 = new PanelLayout();

    public PanelLayout getLayoutPanel1() {
        return layoutPanel1;
    }

    public void setLayoutPanel1(PanelLayout pl) {
        this.layoutPanel1 = pl;
    }
    private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel24() {
        return gridPanel24;
    }

    public void setGridPanel24(HtmlPanelGrid hpg) {
        this.gridPanel24 = hpg;
    }
    private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel27() {
        return gridPanel27;
    }

    public void setGridPanel27(HtmlPanelGrid hpg) {
        this.gridPanel27 = hpg;
    }
    private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel28() {
        return gridPanel28;
    }

    public void setGridPanel28(HtmlPanelGrid hpg) {
        this.gridPanel28 = hpg;
    }
    private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel29() {
        return gridPanel29;
    }

    public void setGridPanel29(HtmlPanelGrid hpg) {
        this.gridPanel29 = hpg;
    }
    private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel30() {
        return gridPanel30;
    }

    public void setGridPanel30(HtmlPanelGrid hpg) {
        this.gridPanel30 = hpg;
    }
    private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel31() {
        return gridPanel31;
    }

    public void setGridPanel31(HtmlPanelGrid hpg) {
        this.gridPanel31 = hpg;
    }
    private HtmlPanelGrid gridPanel32 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel32() {
        return gridPanel32;
    }

    public void setGridPanel32(HtmlPanelGrid hpg) {
        this.gridPanel32 = hpg;
    }
    private HtmlPanelGrid gridPanel33 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel33() {
        return gridPanel33;
    }

    public void setGridPanel33(HtmlPanelGrid hpg) {
        this.gridPanel33 = hpg;
    }
    private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel34() {
        return gridPanel34;
    }

    public void setGridPanel34(HtmlPanelGrid hpg) {
        this.gridPanel34 = hpg;
    }
    private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel35() {
        return gridPanel35;
    }

    public void setGridPanel35(HtmlPanelGrid hpg) {
        this.gridPanel35 = hpg;
    }
    private HtmlPanelGrid gridPanel36 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel36() {
        return gridPanel36;
    }

    public void setGridPanel36(HtmlPanelGrid hpg) {
        this.gridPanel36 = hpg;
    }
    private HtmlOutputText outputText6 = new HtmlOutputText();

    public HtmlOutputText getOutputText6() {
        return outputText6;
    }

    public void setOutputText6(HtmlOutputText hot) {
        this.outputText6 = hot;
    }
    private HtmlOutputText outputText7 = new HtmlOutputText();

    public HtmlOutputText getOutputText7() {
        return outputText7;
    }

    public void setOutputText7(HtmlOutputText hot) {
        this.outputText7 = hot;
    }
    private HtmlOutputText outputText8 = new HtmlOutputText();

    public HtmlOutputText getOutputText8() {
        return outputText8;
    }

    public void setOutputText8(HtmlOutputText hot) {
        this.outputText8 = hot;
    }
    private HtmlOutputText outputText9 = new HtmlOutputText();

    public HtmlOutputText getOutputText9() {
        return outputText9;
    }

    public void setOutputText9(HtmlOutputText hot) {
        this.outputText9 = hot;
    }
    private HtmlSelectOneListbox listboxPersona = new HtmlSelectOneListbox();

    public HtmlSelectOneListbox getListboxPersona() {
        listboxPersona = new HtmlSelectOneListbox();
        String idPersona="";
        String nombrePersona="";
        grupoInvBO = new GrupoInvestigacionBO();
        List<PersonaVO> listarPersonas = new ArrayList<PersonaVO>();
        List collection = new ArrayList();
        try{
            listarPersonas=grupoInvBO.listarPersonas();
            collection.add(new SelectItem("0", "Seleccione una persona"));
            for (int i=0; i<listarPersonas.size();i++) {
                idPersona =listarPersonas.get(i).getIdPersona();
                nombrePersona= listarPersonas.get(i).getNombrePersona();
                collection.add(new SelectItem(idPersona, nombrePersona));
            } // end for
            UISelectItems listaMenu = new UISelectItems();
            listaMenu.setValue(collection);
            listboxPersona.getChildren().add(listaMenu);
        }catch(Exception e){
            e.getStackTrace();
        }
        return listboxPersona;
    }

    public void setListboxPersona(HtmlSelectOneListbox hsol) {
        this.listboxPersona = hsol;
    }
    private DefaultSelectItemsArray listbox1DefaultItems = new DefaultSelectItemsArray();

    public DefaultSelectItemsArray getListbox1DefaultItems() {
        return listbox1DefaultItems;
    }

    public void setListbox1DefaultItems(DefaultSelectItemsArray dsia) {
        this.listbox1DefaultItems = dsia;
    }
    private UISelectItems listbox1SelectItems = new UISelectItems();

    public UISelectItems getListbox1SelectItems() {
        return listbox1SelectItems;
    }

    public void setListbox1SelectItems(UISelectItems uisi) {
        this.listbox1SelectItems = uisi;
    }
    private HtmlInputText textFieldIdGrupo = new HtmlInputText();

    public HtmlInputText getTextFieldIdGrupo() {
        return textFieldIdGrupo;
    }

    public void setTextFieldIdGrupo(HtmlInputText hit) {
        this.textFieldIdGrupo = hit;
    }
    private HtmlSelectOneListbox listboxRol = new HtmlSelectOneListbox();

    public HtmlSelectOneListbox getListboxRol() {
        listboxRol = new HtmlSelectOneListbox();
        int idRol=0;
        String nombreRol="";
        grupoInvBO = new GrupoInvestigacionBO();
        List<RolVO> listarRoles = new ArrayList<RolVO>();
        List collection = new ArrayList();
        try{
            listarRoles=grupoInvBO.listarRoles();
            collection.add(new SelectItem(0, "Seleccione un Rol"));
            for (int i=0; i<listarRoles.size();i++) {
                idRol =listarRoles.get(i).getIdRol();
                nombreRol= listarRoles.get(i).getNombreRol();
                collection.add(new SelectItem(idRol, nombreRol));
            } // end for
            UISelectItems listaMenu = new UISelectItems();
            listaMenu.setValue(collection);
            listboxRol.getChildren().add(listaMenu);
        }catch(Exception e){
            e.getStackTrace();
        }
        return listboxRol;
    }

    public void setListboxRol(HtmlSelectOneListbox hsol) {
        this.listboxRol = hsol;
    }
    private DefaultSelectItemsArray listbox2DefaultItems = new DefaultSelectItemsArray();

    public DefaultSelectItemsArray getListbox2DefaultItems() {
        return listbox2DefaultItems;
    }

    public void setListbox2DefaultItems(DefaultSelectItemsArray dsia) {
        this.listbox2DefaultItems = dsia;
    }
    private UISelectItems listbox2SelectItems = new UISelectItems();

    public UISelectItems getListbox2SelectItems() {
        return listbox2SelectItems;
    }

    public void setListbox2SelectItems(UISelectItems uisi) {
        this.listbox2SelectItems = uisi;
    }
    private HtmlCommandButton buttonAdicionar = new HtmlCommandButton();

    public HtmlCommandButton getButtonAdicionar() {
        return buttonAdicionar;
    }

    public void setButtonAdicionar(HtmlCommandButton hcb) {
        this.buttonAdicionar = hcb;
    }
    private HtmlCommandButton buttonVolver = new HtmlCommandButton();

    public HtmlCommandButton getButtonVolver() {
        return buttonVolver;
    }

    public void setButtonVolver(HtmlCommandButton hcb) {
        this.buttonVolver = hcb;
    }
    private HtmlPanelGrid gridPanel37 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel37() {
        return gridPanel37;
    }

    public void setGridPanel37(HtmlPanelGrid hpg) {
        this.gridPanel37 = hpg;
    }
    private HtmlPanelGrid gridPanel38 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel38() {
        return gridPanel38;
    }

    public void setGridPanel38(HtmlPanelGrid hpg) {
        this.gridPanel38 = hpg;
    }
    private Table tablePersonGroup = new Table();

    public Table getTablePersonGroup() {
        return tablePersonGroup;
    }

    public void setTablePersonGroup(Table t) {
        this.tablePersonGroup = t;
    }
    private TableRowGroup tableRowGroup2 = new TableRowGroup();

    public TableRowGroup getTableRowGroup2() {
        return tableRowGroup2;
    }

    public void setTableRowGroup2(TableRowGroup trg) {
        this.tableRowGroup2 = trg;
    }
    private HtmlOutputText outputText10 = new HtmlOutputText();

    public HtmlOutputText getOutputText10() {
        return outputText10;
    }

    public void setOutputText10(HtmlOutputText hot) {
        this.outputText10 = hot;
    }
    private TableColumn tableColumn14 = new TableColumn();

    public TableColumn getTableColumn14() {
        return tableColumn14;
    }

    public void setTableColumn14(TableColumn tc) {
        this.tableColumn14 = tc;
    }
    private StaticText staticText11 = new StaticText();

    public StaticText getStaticText11() {
        return staticText11;
    }

    public void setStaticText11(StaticText st) {
        this.staticText11 = st;
    }
    private TableColumn tableColumn15 = new TableColumn();

    public TableColumn getTableColumn15() {
        return tableColumn15;
    }

    public void setTableColumn15(TableColumn tc) {
        this.tableColumn15 = tc;
    }
    private StaticText staticText13 = new StaticText();

    public StaticText getStaticText13() {
        return staticText13;
    }

    public void setStaticText13(StaticText st) {
        this.staticText13 = st;
    }
    private TableColumn tableColumn16 = new TableColumn();

    public TableColumn getTableColumn16() {
        return tableColumn16;
    }

    public void setTableColumn16(TableColumn tc) {
        this.tableColumn16 = tc;
    }
    private Button buttonEliminarPersona = new Button();

    public Button getButtonEliminarPersona() {
        return buttonEliminarPersona;
    }

    public void setButtonEliminarPersona(Button b) {
        this.buttonEliminarPersona = b;
    }
    private HtmlMessages messageList1 = new HtmlMessages();

    public HtmlMessages getMessageList1() {
        return messageList1;
    }

    public void setMessageList1(HtmlMessages hm) {
        this.messageList1 = hm;
    }
    private Tab tabVerGrupo = new Tab();

    public Tab getTabVerGrupo() {
        return tabVerGrupo;
    }

    public void setTabVerGrupo(Tab t) {
        this.tabVerGrupo = t;
    }
    private PanelLayout layoutPanel2 = new PanelLayout();

    public PanelLayout getLayoutPanel2() {
        return layoutPanel2;
    }

    public void setLayoutPanel2(PanelLayout pl) {
        this.layoutPanel2 = pl;
    }
    private HtmlPanelGrid panelInformacion1 = new HtmlPanelGrid();

    public HtmlPanelGrid getPanelInformacion1() {
        return panelInformacion1;
    }

    public void setPanelInformacion1(HtmlPanelGrid hpg) {
        this.panelInformacion1 = hpg;
    }
    private HtmlOutputText outputInformacion1 = new HtmlOutputText();

    public HtmlOutputText getOutputInformacion1() {
        return outputInformacion1;
    }

    public void setOutputInformacion1(HtmlOutputText hot) {
        this.outputInformacion1 = hot;
    }
    private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel11() {
        return gridPanel11;
    }

    public void setGridPanel11(HtmlPanelGrid hpg) {
        this.gridPanel11 = hpg;
    }
    private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel12() {
        return gridPanel12;
    }

    public void setGridPanel12(HtmlPanelGrid hpg) {
        this.gridPanel12 = hpg;
    }
    private HtmlOutputText outputText1 = new HtmlOutputText();

    public HtmlOutputText getOutputText1() {
        return outputText1;
    }

    public void setOutputText1(HtmlOutputText hot) {
        this.outputText1 = hot;
    }
    private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel13() {
        return gridPanel13;
    }

    public void setGridPanel13(HtmlPanelGrid hpg) {
        this.gridPanel13 = hpg;
    }
    private HtmlInputTextarea areaNombre = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaNombre() {
        return areaNombre;
    }

    public void setAreaNombre(HtmlInputTextarea hit) {
        this.areaNombre = hit;
    }
    private HiddenField hiddenIdGrupo = new HiddenField();

    public HiddenField getHiddenIdGrupo() {
        return hiddenIdGrupo;
    }

    public void setHiddenIdGrupo(HiddenField hf) {
        this.hiddenIdGrupo = hf;
    }
    private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel14() {
        return gridPanel14;
    }

    public void setGridPanel14(HtmlPanelGrid hpg) {
        this.gridPanel14 = hpg;
    }
    private HtmlOutputText outputText2 = new HtmlOutputText();

    public HtmlOutputText getOutputText2() {
        return outputText2;
    }

    public void setOutputText2(HtmlOutputText hot) {
        this.outputText2 = hot;
    }
    private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel15() {
        return gridPanel15;
    }

    public void setGridPanel15(HtmlPanelGrid hpg) {
        this.gridPanel15 = hpg;
    }
    private HtmlInputTextarea areaMision = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaMision() {
        return areaMision;
    }

    public void setAreaMision(HtmlInputTextarea hit) {
        this.areaMision = hit;
    }
    private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel16() {
        return gridPanel16;
    }

    public void setGridPanel16(HtmlPanelGrid hpg) {
        this.gridPanel16 = hpg;
    }
    private HtmlOutputText outputText3 = new HtmlOutputText();

    public HtmlOutputText getOutputText3() {
        return outputText3;
    }

    public void setOutputText3(HtmlOutputText hot) {
        this.outputText3 = hot;
    }
    private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel17() {
        return gridPanel17;
    }

    public void setGridPanel17(HtmlPanelGrid hpg) {
        this.gridPanel17 = hpg;
    }
    private HtmlInputTextarea areaVision = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaVision() {
        return areaVision;
    }

    public void setAreaVision(HtmlInputTextarea hit) {
        this.areaVision = hit;
    }
    private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel18() {
        return gridPanel18;
    }

    public void setGridPanel18(HtmlPanelGrid hpg) {
        this.gridPanel18 = hpg;
    }
    private HtmlOutputText outputText4 = new HtmlOutputText();

    public HtmlOutputText getOutputText4() {
        return outputText4;
    }

    public void setOutputText4(HtmlOutputText hot) {
        this.outputText4 = hot;
    }
    private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel19() {
        return gridPanel19;
    }

    public void setGridPanel19(HtmlPanelGrid hpg) {
        this.gridPanel19 = hpg;
    }
    private HtmlInputTextarea areaPoliticas = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaPoliticas() {
        return areaPoliticas;
    }

    public void setAreaPoliticas(HtmlInputTextarea hit) {
        this.areaPoliticas = hit;
    }
    private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel20() {
        return gridPanel20;
    }

    public void setGridPanel20(HtmlPanelGrid hpg) {
        this.gridPanel20 = hpg;
    }
    private HtmlOutputText outputText5 = new HtmlOutputText();

    public HtmlOutputText getOutputText5() {
        return outputText5;
    }

    public void setOutputText5(HtmlOutputText hot) {
        this.outputText5 = hot;
    }
    private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel21() {
        return gridPanel21;
    }

    public void setGridPanel21(HtmlPanelGrid hpg) {
        this.gridPanel21 = hpg;
    }
    private HtmlInputText textemail = new HtmlInputText();

    public HtmlInputText getTextemail() {
        return textemail;
    }

    public void setTextemail(HtmlInputText hit) {
        this.textemail = hit;
    }
    private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel22() {
        return gridPanel22;
    }

    public void setGridPanel22(HtmlPanelGrid hpg) {
        this.gridPanel22 = hpg;
    }
    private HtmlOutputText outputText11 = new HtmlOutputText();

    public HtmlOutputText getOutputText11() {
        return outputText11;
    }

    public void setOutputText11(HtmlOutputText hot) {
        this.outputText11 = hot;
    }
    private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel23() {
        return gridPanel23;
    }

    public void setGridPanel23(HtmlPanelGrid hpg) {
        this.gridPanel23 = hpg;
    }
    private HtmlInputText textFieldFecha = new HtmlInputText();

    public HtmlInputText getTextFieldFecha() {
        return textFieldFecha;
    }

    public void setTextFieldFecha(HtmlInputText hit) {
        this.textFieldFecha = hit;
    }
    private HtmlPanelGrid gridPanel39 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel39() {
        return gridPanel39;
    }

    public void setGridPanel39(HtmlPanelGrid hpg) {
        this.gridPanel39 = hpg;
    }
    private HtmlOutputText outputText12 = new HtmlOutputText();

    public HtmlOutputText getOutputText12() {
        return outputText12;
    }

    public void setOutputText12(HtmlOutputText hot) {
        this.outputText12 = hot;
    }
    private HtmlPanelGrid gridPanel40 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel40() {
        return gridPanel40;
    }

    public void setGridPanel40(HtmlPanelGrid hpg) {
        this.gridPanel40 = hpg;
    }
    private HtmlCommandButton buttonIntegrantes = new HtmlCommandButton();

    public HtmlCommandButton getButtonIntegrantes() {
        return buttonIntegrantes;
    }

    public void setButtonIntegrantes(HtmlCommandButton hcb) {
        this.buttonIntegrantes = hcb;
    }
    private HtmlPanelGrid gridPanel41 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel41() {
        return gridPanel41;
    }

    public void setGridPanel41(HtmlPanelGrid hpg) {
        this.gridPanel41 = hpg;
    }
    private HtmlCommandButton botonModificar = new HtmlCommandButton();

    public HtmlCommandButton getBotonModificar() {
        return botonModificar;
    }

    public void setBotonModificar(HtmlCommandButton hcb) {
        this.botonModificar = hcb;
    }
    private HtmlPanelGrid gridPanel42 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel42() {
        return gridPanel42;
    }

    public void setGridPanel42(HtmlPanelGrid hpg) {
        this.gridPanel42 = hpg;
    }
    private HtmlCommandButton botonPartEventos = new HtmlCommandButton();

    public HtmlCommandButton getBotonPartEventos() {
        return botonPartEventos;
    }

    public void setBotonPartEventos(HtmlCommandButton hcb) {
        this.botonPartEventos = hcb;
    }
    private HtmlMessages messageList2 = new HtmlMessages();

    public HtmlMessages getMessageList2() {
        return messageList2;
    }

    public void setMessageList2(HtmlMessages hm) {
        this.messageList2 = hm;
    }
    private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel10() {
        return gridPanel10;
    }

    public void setGridPanel10(HtmlPanelGrid hpg) {
        this.gridPanel10 = hpg;
    }
    private HtmlMessages messageList3 = new HtmlMessages();

    public HtmlMessages getMessageList3() {
        return messageList3;
    }

    public void setMessageList3(HtmlMessages hm) {
        this.messageList3 = hm;
    }
    private HtmlCommandButton buttonVolver1 = new HtmlCommandButton();

    public HtmlCommandButton getButtonVolver1() {
        return buttonVolver1;
    }

    public void setButtonVolver1(HtmlCommandButton hcb) {
        this.buttonVolver1 = hcb;
    }
    private HtmlOutputText outputText13 = new HtmlOutputText();

    public HtmlOutputText getOutputText13() {
        return outputText13;
    }

    public void setOutputText13(HtmlOutputText hot) {
        this.outputText13 = hot;
    }
    private HtmlInputText textFieldIdGrupo1 = new HtmlInputText();

    public HtmlInputText getTextFieldIdGrupo1() {
        return textFieldIdGrupo1;
    }

    public void setTextFieldIdGrupo1(HtmlInputText hit) {
        this.textFieldIdGrupo1 = hit;
    }

    // </editor-fold>

    /**
     * <p>Construct a new Page bean instance.</p>
     */
    public ConsultarGrupo() {
    }

    /**
     * <p>Callback method that is called whenever a page is navigated to,
     * either directly via a URL, or indirectly via page navigation.
     * Customize this method to acquire resources that will be needed
     * for event handlers and lifecycle methods, whether or not this
     * page is performing post back processing.</p>
     * 
     * <p>Note that, if the current request is a postback, the property
     * values of the components do <strong>not</strong> represent any
     * values submitted with this request.  Instead, they represent the
     * property values that were saved for this view when it was rendered.</p>
     */
    @Override
    public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
        
        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("ConsultarGrupo Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        }
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
    }

    /**
     * <p>Callback method that is called after the component tree has been
     * restored, but before any event processing takes place.  This method
     * will <strong>only</strong> be called on a postback request that
     * is processing a form submit.  Customize this method to allocate
     * resources that will be required in your event handlers.</p>
     */
    @Override
    public void preprocess() {
    }

    /**
     * <p>Callback method that is called just before rendering takes place.
     * This method will <strong>only</strong> be called for the page that
     * will actually be rendered (and not, for example, on a page that
     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
     */
    @Override
    public void prerender() {
    }

    /**
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called (regardless of whether
     * or not this was the page that was actually rendered).  Customize this
     * method to release resources acquired in the <code>init()</code>,
     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
     * acquired during execution of an event handler).</p>
     */
    @Override
    public void destroy() {
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected RequestBean1 getRequestBean1() {
        return (RequestBean1) getBean("RequestBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1) getBean("ApplicationBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected SessionBean1 getSessionBean1() {
        return (SessionBean1) getBean("SessionBean1");
    }

    private String nombreGrupo="";
    
    private List<GrupoInvestigacionVO> listaGrupo;
    private List<PersonaVO> listaPersonasGrupo;
    private GrupoInvestigacionVO grupoInvVO;    
    private GrupoInvestigacionBO grupoInvBO;
        
    public String botonConsultar_action() throws ControlException{
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        try{
            tablaConsultaGrupo.setRendered(true);
            grupoInvVO = new GrupoInvestigacionVO();
            grupoInvBO = new GrupoInvestigacionBO();
            listaGrupo =  new ArrayList<GrupoInvestigacionVO>();
            String idG = (String) textFieldIdGrupo1.getValue();            
            nombreGrupo=(String) textoNombre.getValue();
            grupoInvVO.setIdConsulta(idG);
            grupoInvVO.setNombreGrupo(nombreGrupo);
            listaGrupo=grupoInvBO.consultarGrupoInv(grupoInvVO);
            getSessionBean1().addListaGrupos(listaGrupo);
            //this.setListaGrupo(listaGrupo);
            
        }catch(ControlException ce){
            error("Error al consultar el grupo de investigación.");
            ce.getStackTrace();
        }
        return "OK";
    }

    public String botonEliminar_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        String algo="", resultado="";
        int idGrupo=0;
        RowKey rowToRemove =tableRowGroup3.getRowKey();
        ListaTablaGrupo listaTablaGrupo = getSessionBean1().getListaDatos();
        try{
            grupoInvVO = new GrupoInvestigacionVO();
            grupoInvBO= new GrupoInvestigacionBO();
            idGrupo = (Integer) getValue("#{currentRow.value['idGrupo']}");
            grupoInvVO.setIdGrupo(idGrupo);
            //CachedRowSet grupoSelct = getSessionBean1().getGrupoleRowSet();            
           
            resultado=grupoInvBO.eliminarGrupoInv(grupoInvVO);           
            if(resultado.equals("si pudo")){
                 listaTablaGrupo.removeRow(rowToRemove);
                listaTablaGrupo.commitChanges();
                info("El grupo se ha eliminado correctamente.");
            }else if(resultado.equals("no pudo")){
                error("El grupo no se puede eliminar porque tiene proyectos que en su estado no es cerrado.");
            }else{
                error("Error al eliminar el grupo");
            }
        }catch(Exception e){
            listaTablaGrupo.revertChanges();
            e.getStackTrace();
            error("error al eliminar el grupo.");
        }
        return "Eliminar";
    }

    public String botonVer_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        int idGrupo=0;
        GrupoInvestigacionVO grupoInvestigacionVO = new GrupoInvestigacionVO();
        listaPersonasGrupo = new ArrayList<PersonaVO>();
        try{
            grupoInvBO = new GrupoInvestigacionBO();
            grupoInvVO = new GrupoInvestigacionVO();            
            idGrupo = (Integer) getValue("#{currentRow.value['idGrupo']}");
            grupoInvVO.setIdGrupo(idGrupo);            
            grupoInvestigacionVO=grupoInvBO.consultarGrupoPK(grupoInvVO);
            hiddenIdGrupo.setValue(grupoInvestigacionVO.getIdGrupo());
            areaNombre.setValue(grupoInvestigacionVO.getNombreGrupo());
            areaMision.setValue(grupoInvestigacionVO.getMisionGrupo());
            areaVision.setValue(grupoInvestigacionVO.getVisionGrupo());
            areaPoliticas.setValue(grupoInvestigacionVO.getPoliticasGrupo());
            textemail.setValue(grupoInvestigacionVO.getEmailGrupo());
            textFieldFecha.setValue(grupoInvestigacionVO.getFechaRegistro());
            textFieldIdGrupo.setValue(grupoInvestigacionVO.getIdGrupo());
            
            grupoInvBO = new GrupoInvestigacionBO();
            listaPersonasGrupo = grupoInvBO.listarPersonaGrupo(grupoInvestigacionVO);
            getSessionBean1().addListaPersona(listaPersonasGrupo);
            tabSet1.setSelected(tabVerGrupo.getId().toString());
        }catch(Exception e){
            e.getStackTrace();
            error("error en los datos.");
        }
        return "Ver";
    }
    private int idGrupo=0;
    private String misionGrupo="", visionGrupo="", politicasGrupo="", emailGrupo="", resultado="";
    private Date fechaRegistro=null;
    
    public String botonModificar_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.        
        
        // Try Catch Exception
        // This clip shows how to create a try/catch
        // statement to handle possible exceptions
        try {
          // TODO: Insert logic that may cause an exception
          // for example, performing database logic or file access
            grupoInvVO = new GrupoInvestigacionVO();
            grupoInvBO = new GrupoInvestigacionBO();
            idGrupo = (Integer) hiddenIdGrupo.getValue();
            misionGrupo = (String) areaMision.getValue();
            visionGrupo = (String) areaVision.getValue();
            emailGrupo = (String) textemail.getValue();
            politicasGrupo = (String) areaPoliticas.getValue();
            
            if(misionGrupo==null || misionGrupo.equals("")){
                error("Por favor digite la Misión del grupo de investigación.");
                return null;
            }else if(visionGrupo==null || visionGrupo.equals("")){
                error("Por favor digite la Visión del grupo de investigación.");
                return null;
            }else if(politicasGrupo==null || politicasGrupo.equals("")){
                error("Por favor digite las Políticas del grupo de investigación.");
                return null;
            }else if(emailGrupo==null || emailGrupo.equals("") || !emailGrupo.contains("@")){
                error("Por favor digite el E-mail del grupo de investigación.");
                return null;
            }
            
            grupoInvVO.setIdGrupo(idGrupo);
            grupoInvVO.setNombreGrupo(nombreGrupo);
            grupoInvVO.setMisionGrupo(misionGrupo);
            grupoInvVO.setVisionGrupo(visionGrupo);            
            grupoInvVO.setPoliticasGrupo(politicasGrupo);
            grupoInvVO.setEmailGrupo(emailGrupo);
            
            resultado=grupoInvBO.modificarGrupoInv(grupoInvVO);
            
            if(resultado.equals("modifico")){
                info("el grupo de investigación se ha modificado correctamente.");
            }
            else{
                error("el grupo de investigación no se pudo modificar.");
            }
        } catch (Exception e) {
           // print exception information in the server log
            e.getStackTrace();
            error("error al modificar el grupo de investigación.");
           // view log messages using View Server Log menu item 
           // on the Deployment Server node in the Server Navigator
           // TODO: either handle the exception or pass it to the Faces layer
           // throw new FacesException(e);
        }
        
        return "OK";
    }

    public String botonPartEventos_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        GrupoInvestigacionVO grupoInvestigacionVOVO = new GrupoInvestigacionVO();
        grupoInvestigacionVOVO.setIdGrupo((Integer) hiddenIdGrupo.getValue());
        grupoInvestigacionVOVO.setNombreGrupo((String) areaNombre.getValue());
        getRequestBean1().setGrupoInvVO(grupoInvestigacionVOVO);
        return "ParticipacionEventos";
    }
    
    public String buttonEliminarPersona_action() {
        // TODO: Replace with your code
        ListaTablaPersonas tablaGrupo = getSessionBean1().getListaDatosPersonas();
        try{            
            RowKey rowToremove = tableRowGroup2.getRowKey();
            grupoInvBO = new GrupoInvestigacionBO();
            grupoInvVO = new GrupoInvestigacionVO();
            personaVO = new PersonaVO();
            idPersona = (String) getValue("#{currentRow.value['idPersona']}");
            idGrupo = (Integer) textFieldIdGrupo.getValue();
            grupoInvVO.setIdGrupo(idGrupo);
            personaVO.setIdPersona(idPersona);
            resultado=grupoInvBO.eliminarPeronaGrupo(grupoInvVO, personaVO);
            if(resultado.equals("elimino")){
                tablaGrupo.removeRow(rowToremove);
                tablaGrupo.commitChanges();
                info("El integrante del grupo se ha eliminado.");
            }else{
                error("no se pudo eliminar el integrante porque se encuentra inscrito en enventos del grupo.");
            }
        }catch(Exception e){
            tablaGrupo.revertChanges();
            error("Error al eliminar el integrante del grupo..."+e);
        }
        return null;
    }
    
    private  PersonaVO personaVO;
    private  RolVO rolVO;
    private String idPersona="";
    private int idRol=0;

    public String buttonAdicionar_action() {
        // TODO: Replace with your code
        try{

            grupoInvBO = new GrupoInvestigacionBO();
            grupoInvVO = new GrupoInvestigacionVO();
            personaVO = new PersonaVO();
            rolVO = new RolVO();
            
            idGrupo = (Integer) textFieldIdGrupo.getValue();
            idPersona = (String) listboxPersona.getValue();
            String idR = (String) listboxRol.getValue();
            idRol = Integer.parseInt(idR);
            
            if(idGrupo==0){
                error("no hay un grupo asociado.");
                return null;
            }else if(idPersona.equals("0")){
                error("Por favor seleccione una persona.");
                return null;
            }else if(idRol==0){
                error("Por favor seleccione un rol.");
                return null;
            }
            grupoInvVO.setIdGrupo(idGrupo);
            personaVO.setIdPersona(idPersona);
            rolVO.setIdRol(idRol);
            resultado=grupoInvBO.insertarGrupoPersonaRol(grupoInvVO, personaVO, rolVO);
            listaPersonasGrupo = grupoInvBO.listarPersonaGrupo(grupoInvVO);
            getSessionBean1().addListaPersona(listaPersonasGrupo);
            if(resultado.equals("inserto")){
                info("La persona se adicionó correctamente al grupo de investigación.");
            }else if(resultado.equals("no inserto")){
                error("La persona ya está vinculada a un grupo de investigación.");
            }else{
                error("No se puede adicionar la persona al grupo de investigación.");
            }
            
        }catch(Exception e){
            error("Error al adicionar el integrante del grupo");
        }
        return null;
    }

    public String buttonVolver_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        tabSet1.setSelected(tabVerGrupo.getId().toString());
        return null;
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected ParticipacionEventos getGruposInvestigacion$ParticipacionEventos() {
        return (ParticipacionEventos) getBean("GruposInvestigacion$ParticipacionEventos");
    }

    public String buttonIntegrantes_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        tabSet1.setSelected(tab4.getId().toString());
        return null;
    }

    public String buttonVolver1_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        tabSet1.setSelected(tabConsultarGrupo.getId().toString());
        return null;
    }
    
    private static boolean esNumero(String cadena){
        try {
		Integer.parseInt(cadena);
		return true;
	} catch (NumberFormatException nfe){
		return false;
	}
    }
}

